import java.io.*;

/*
ID: qingtia2
LANG: JAVA
TASK: friday
*/
class friday {

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new FileReader("friday.in"));
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("friday.out")));
        Integer n = Integer.parseInt(in.readLine());
        int totalMonth = 12 * n;
        int start = 1;
        int temp = 0;
        int month = 1;
        int year = 1900;
        int countOne = 0, countTwo = 0, countThree = 0, countFour = 0, countFive = 0, countSix = 0, countServen = 0;
        for (int i = 0; i < totalMonth; i++) {
            switch (month) {
                case 12:
                    month = 0;
                case 10:
                case 8:
                case 7:
                case 5:
                case 3:
                case 1:
                    temp = (31 % 7 + start) % 7;
                    month++;
                    break;
                case 11:
                case 9:
                case 6:
                case 4:
                    temp = (30 % 7 + start) % 7;
                    month++;
                    break;
                case 2:
                    if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
                        temp = (29 % 7 + start) % 7;
                    else
                        temp = start % 7;
                    month++;
                    year++;
                    break;
            }
            switch ((start + 12) % 7) {
                case 6:
                    countSix++;
                    break;
                case 0:
                    countServen++;
                    break;
                case 1:
                    countOne++;
                    break;
                case 2:
                    countTwo++;
                    break;
                case 3:
                    countThree++;
                    break;
                case 4:
                    countFour++;
                    break;
                case 5:
                    countFive++;
                    break;
            }
            start = temp;
        }
        out.println(countSix + " " + countServen + " " + countOne + " " + countTwo + " " + countThree + " " + countFour + " " + countFive);
        out.close();
    }
}
